<%@ page language="java" import="java.util.*" isELIgnored="false" contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<% 
	String path = request.getContextPath();
	session.setAttribute("path", path);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>控制台页面_企业工资管理系统</title>
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="${path}/resources/css/style.default.css" type="text/css" />
<script type="text/javascript" src="${path}/resources/js/plugins/jquery-1.7.min.js"></script>
<script type="text/javascript" src="${path}/resources/js/plugins/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="${path}/resources/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="${path}/resources/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="${path}/resources/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="${path}/resources/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="${path}/resources/js/plugins/charCount.js"></script>
<script type="text/javascript" src="${path}/resources/js/plugins/ui.spinner.min.js"></script>
<script type="text/javascript" src="${path}/resources/js/plugins/chosen.jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${path}/resources/js/general.js"></script>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/plugins/excanvas.min.js"></script><![endif]-->
<!--[if IE 9]>
    <link rel="stylesheet" media="screen" href="css/style.ie9.css"/>
<![endif]-->
<!--[if IE 8]>
    <link rel="stylesheet" media="screen" href="css/style.ie8.css"/>
<![endif]-->
<!--[if lt IE 9]>
	<script src="js/plugins/css3-mediaqueries.js"></script>
<![endif]-->
<script>
jQuery(document).ready(function(){
	jQuery(".notibar.msgsuccess.msgsuccess").hide();
	jQuery(".notibar.msgerror").hide();
	jQuery("#updatePasswordForm").submit(function(){
		var originPassword=jQuery("#originPassword").val();
		var newPassword = jQuery("#newPassword").val();
		var confirmPassword = jQuery("#confirmPassword").val();
		if(originPassword!="${employee.password}"){
			jQuery(".notibar.msgerror").show();
			jQuery(".notibar.msgerror>p").html("修改密码失败,原始密码错误");
		}else if(newPassword!=confirmPassword){
			jQuery(".notibar.msgerror").show();
			jQuery(".notibar.msgerror>p").html("修改密码失败,2次输入密码不一致");
		}else{
			jQuery.ajax({
				url:"${path}/employee/updatePassword",
				async:false,
				data:{password:newPassword},
				dataType:"json",
				type:"post",
				success:function(data){
					if(data.result==1){
						jQuery(".notibar.msgsuccess").show();
						jQuery(".notibar.msgerror").hide();
						jQuery("input[type=password]").val("");
					}else{
						jQuery(".notibar.msgerror").show();
						jQuery(".notibar.msgsuccess").hide();
					}
				}
			});
		}
		return false;
	});
});
</script>
<style>
	.vernav2{
		top:170px;
	}
</style>
</head>

<body class="withvernav">
	<div class="bodywrapper">
		<div class="topheader">
			<div class="left">
				<h1 class="logo">
					企业<span>工资管理系统</span>
				</h1>
				<br clear="all" />
			</div>
			<!--left-->

			<div class="right">
				<div class="userinfo">
					<img src="${path}/resources/images/thumbs/avatar.png" alt="" />
					<span> ${employee.empNo}</span>
				</div>
				<!--userinfo-->

				<div class="userinfodrop">
					<div class="avatar">
						<a href=""><img src="${path}/resources/images/thumbs/avatarbig.png" alt="" /></a>
						<div class="changetheme">
							切换主题: <br /> <a class="default"></a> <a class="blueline"></a> <a
								class="greenline"></a> <a class="contrast"></a> <a
								class="custombg"></a>
						</div>
					</div>
					<!--avatar-->
					<div class="userdata">
						<h4>${employee.empName}</h4>
						<span class="email">${employee.empEmail}</span>
						<ul>
							<li><a href="${path}/employee/editProfile">编辑资料</a></li>
							<li><a href="${path}/employee/password">修改密码</a></li>
							<li><a href="#">帮助</a></li>
							<li><a href="${path}/employee/logout">退出</a></li>
						</ul>
					</div>
					<!--userdata-->
				</div>
				<!--userinfodrop-->
			</div>
			<!--right-->
		</div>
		<!--topheader-->


		<div class="header">
			<ul class="headermenu">
				<li class="current"><a href="${path}/employee/profile"><span
						class="icon icon-flatscreen"></span>首页</a></li>
				<li><a href="${path}/department"><span
						class="icon icon-pencil"></span>部门信息管理</a></li>
				<li><a href="${path}/post"><span
						class="icon icon-message"></span>岗位信息管理</a></li>
				<li><a href="${path}/employee"><span
						class="icon icon-pencil"></span>员工信息管理</a></li>
				<c:if test="${employee.isAdmin == 1 }">
				<li><a href="${path}/timecard"><span
						class="icon icon-speech"></span>考勤信息管理</a></li>
				</c:if>
				<c:if test="${employee.isAdmin == 0 }">
				<li><a href="${path}/timecard/myTimecards"><span
						class="icon icon-speech"></span>考勤信息管理</a></li>
				</c:if>
				<li><a href="${path}/bonus"><span 
						class="icon icon-chart"></span>奖金信息管理</a></li>
				<li><a href="${path}/salaryRecord"><span 
						class="icon icon-message"></span>工资信息管理</a></li>
			</ul>
		</div>
		<!--header-->

		<div class="vernav2 iconmenu">
			<ul>
				<li><a href="${path}/department" class="widgets">部门信息管理</a></li>
	        	<li><a href="${path}/post" class="support">岗位信息管理</a></li>
	            <li><a href="${path}/employee" class="tables">员工信息管理</a></li>
	            <li><a href="#attend" class="calendar">考勤信息管理</a>
	            	<span class="arrow"></span>
	            	<ul id="attend">
	            		<c:if test="${employee.isAdmin == 1 }">
	               		<li><a href="${path}/timecard">考勤-日历模式</a></li>
	               		</c:if>
	               		<c:if test="${employee.isAdmin == 0 }">
	               		<li><a href="${path}/timecard/myTimecards">考勤-日历模式</a></li>
	               		</c:if>
	                    <li><a href="${path}/timecard/table">考勤-表格模式</a></li>
	                </ul>
            	</li>
	            <li><a href="${path}/bonus" class="tables">奖金信息管理</a>
	            </li>
	            <li><a href="#salary" class="widgets">工资信息管理</a>
	            	<span class="arrow"></span>
	            	<ul id="salary">
	            		<c:if test="${employee.isAdmin == 1 }">
	            		 <li><a href="${path}/salaryRecord/calPre">工资结算</a></li>
	            		 </c:if>
	                    <li><a href="${path}/salaryRecord">工资记录</a></li>
	                    <c:if test="${employee.isAdmin == 1 }">
	                    <li><a href="${path}/postSalary">工资结构调整</a></li>
	                    </c:if>
	                    <c:if test="${employee.isAdmin == 0 }">
	                    <li><a href="${path}/postSalary/myStructure">我的工资结构</a></li>
	                    </c:if>
	                </ul>
            	</li>
        	</ul>
			<a class="togglemenu"></a> <br />
			<br />
		</div>
		<!--leftmenu-->
        
    <div class="centercontent">
    
        <div id="contentwrapper" class="contentwrapper">
        <div class="notibar msgsuccess">
         <a class="close"></a>
         <p>修改密码成功！</p>
        </div>
        <div class="notibar msgerror">
        <a class="close"></a>
        <p>修改密码失败！</p>
        </div>
        	<div id="updatePassword" class="subcontent">
            	
                    <form id="updatePasswordForm" class="stdform" method="post" >
                    	<p>
                        	<label>原始密码：</label>
                            <span class="field"><input type="password" name="originPassword" id="originPassword" class="smallinput" required /></span>
                        </p>
                        
                        <p>
                        	<label>新密码：</label>
                            <span class="field"><input type="password" name="newPassword" id="newPassword" class="smallinput" required  /></span>
                        </p>
                        
                        <p>
                        	<label>确认密码：</label>
                            <span class="field"><input type="password" name="confirmPassword" id="confirmPassword" class="smallinput" required  /></span>
                        </p>
                        <p class="stdformbutton">
                        	<button class="submit radius2">确认修改</button>
                        </p>
                    </form>

            </div><!--subcontent-->
                    <br />
        </div><!--contentwrapper-->
        
        <br clear="all" />
        
	</div><!-- centercontent -->
    
    
</div><!--bodywrapper-->

</body>
</html>
